using System.Collections.Generic;
using System.Data;

namespace DataScripter.Scripting.Compare.DataTables.Data
{
    public class DataTableDataComparisonResult
    {
        public DataTableDataComparisonResult()
        {
            RowsToInsert = new List<DataRow>();
            RowsToDelete = new List<DataRow>();
            RowsToUpdate = new Dictionary<DataRow, DataRow>();
        }

        public List<DataRow> RowsToInsert { get; private set; }
        public List<DataRow> RowsToDelete { get; private set; }
        public Dictionary<DataRow, DataRow> RowsToUpdate { get; private set; }

        public bool AllRowsAreTheSame()
        {
            return RowsToInsert.Count == 0 && RowsToDelete.Count == 0 && RowsToUpdate.Count == 0;
        }

        public int NumberOfDifferences
        {
            get { return RowsToInsert.Count + RowsToDelete.Count + RowsToUpdate.Count; }
        }
    }
}